<?php
include '../../init.php';

// 是否登录
$uid = $_SESSION['uid'];
if(@!$_SESSION['is_login'] || empty($uid)) {
    show_msg(1,'请先登录');
    exit();
}

// 是否积分够了
$score = array();
$sql = "SELECT score FROM `login_tb` WHERE uid={$uid} LIMIT 1;"
if(!my_mysql_query($sql, $score)) {
    show_msg(1,'获取积分错误,请稍后重试');
    exit();
}
$score = $score[0]['score'];

if($score < 1000) {
    $tip = "你的积分有少于 1000 积分还不能申请版主";
} else {
    $tip = "你的积分有:<span style=\"color:green\"> {$score} </span> 能够申请版主";
}
// 申请版主列表
$modulID = $_GET['modulID'];

?>
<!DOCTYPE HTML>
<html>
    <head>
        <title>版主申请</title>
        <meta charset="utf-8">
        <style type="text/css">
        *{
            padding: 0;
            margin: 0;
        }
        .main-div {
            width: 960px;
            height: 500px;
            padding: 5px;
            margin: 25px auto;
            font-size: 24px;
            text-align: center;
            line-height: 32px;
            background-color: #F8F8F8;
            border: 1px solid rgb(240,240,240);
        }
        </style>
    </head>

    <body>
        <div class="main-div">
            <p><?php echo $tip; ?></p>
            <form action="moderator.php" method="GET">
                <input type="hidden" name="modulID" value="<? echo $modulID; ?>">
                <input type="submit" value="现在申请">
            </form>
        </div>
    </body>
</html>

